﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cuentaItemDeletePanel.ascx.cs" Inherits="UILGestion.VentaAdmin.OrdenVenta.cuentaItemDeletePanel" %>



<%@ Register Assembly="CustomControls" Namespace="CustomControls" TagPrefix="cc1" %>
<script src="../../Scripts/controlGrid.js" type="text/javascript"></script>

 <script type="text/javascript">
     function SelectAll(frm, id) {

         var frm = document.getElementById("itemPlaceHolderContainer");
         for (i = 1; i < frm.rows.length; i++) {
             var checkbox = frm.rows[i].cells[0].childNodes[0];
             if (checkbox != null)
                 checkbox.checked = document.getElementById(id).checked;
         }
     };
    </script>
      <asp:Panel ID="Panel1" runat="server" CssClass="Heading secTitle AreaHeading ms-crm-List-Header " >
                Eliminar Cuotas
                </asp:Panel>
                 <asp:Panel ID="Panel2" runat="server"  class="ms-crm-Form-Body" >

                    

                 <asp:DataPager ID="pager" PagedControlID="ListView1" runat="server" >
    <Fields>
      <cc1:PagerField NextPageImageUrl="~/Images/arrow_right2.gif" PreviousPageImageUrl="~/images/arrow_left.gif" />
    </Fields>
</asp:DataPager>
<asp:ListView ID="ListView1" runat="server" OnDataBound="ListView1_DataBound"   ClientIDMode="Static"  
    DataKeyNames="idInternal" onitemdatabound="ListView1_ItemDataBound">
    <LayoutTemplate>
        <table id="itemPlaceHolderContainer" border="0" runat="server">
            <tr id="Tr1" runat="server"  class="Heading secTitle AreaHeading ms-crm-List-Header">
             <th>
            
           <asp:CheckBox runat="server" ID="chkSelectAll" ClientIDMode="Static" onclick="SelectAll('ListView1','chkSelectAll')" />
            </th>
                <th id="Th1" runat="server">
                    ID <br/> TRANS.
                </th>
                <th id="Th3" runat="server">
                    Saldos Anteriores
                </th>
                 <th id="Th4" runat="server">
                    Nuevas Cuotas
                </th>
                <th id="Th2" runat="server">
                    Total <br />TRANS.
                </th>
            </tr>
            <tr id="itemPlaceholder" runat="server">
            </tr>
        </table>



    </LayoutTemplate>
    <ItemTemplate>
        <tr style='background-color: <%# (Container.DataItemIndex % 2 == 0)?"#eee":"#fff" %>'>
            <td>
         
             <asp:CheckBox runat="server" ID="chkEmployeeSelector"  />
         
                
            </td>
            <td width="55px" >
                    <%# Eval("idInternal")%> <br />
            </td>
            
           
            <td >
          
           
            <asp:Repeater ID="values" runat="server" DataSource='<%# Eval("origen") %>'>
                     <HeaderTemplate>
               <table>
                    <tr>            
                    <td width="50px">NUMERO</td>
                    <td width="75px" align="right">FECH VEN.</td>
                    <td width="75px" align="right">MONEDA</td>
                    <td width="95px" align="right">TOTAL</td>
                    </tr>
            
               </table>
               
               </HeaderTemplate>
                    <ItemTemplate>
                    <table style="background-color:White">
                    <tr>
                    <td  width="50px"> <%# ((DAL.FinanciamientoItem)Container.DataItem).OrdenVentaFormato.numDocumento %>
                    </td>
                    <td width="75px" align="right">
                        <%# ((DAL.FinanciamientoItem)Container.DataItem).OrdenVentaFormato.fechaVencimiento.ToShortDateString()%>
                    </td>
                     <td width="75px" align="right">
                        <%# ((DAL.FinanciamientoItem)Container.DataItem).OrdenVentaFormato.Moneda.descripcion%>
                    </td>
                    <td width="95px" align="right"> 
                    <%# ((DAL.FinanciamientoItem)Container.DataItem).total.ToString("N")%>
                     </td>
                    </tr>
                    </table>
                    </ItemTemplate>
                </asp:Repeater>
            
                
            </td>
            
            <td >
            
            <asp:Repeater ID="Repeater1" runat="server" DataSource='<%# Eval("destino") %>'>
                     <HeaderTemplate>
               <table>
                    <tr>            
                    <td width="50px">NUMERO</td>
                    <td width="75px" align="right">FECH VEN.</td>
                    <td width="75px" align="right">MONEDA</td>
                    <td width="95px" align="right">TOTAL</td>
                    </tr>
            
               </table>
               
               </HeaderTemplate>
                    <ItemTemplate>
                    <table style="background-color:White">
                    <tr>
                    <td  width="50px"> <%# ((DAL.OrdenVentaFormato)Container.DataItem).numDocumento %>
                    </td>
                    <td width="75px" align="right">
                        <%# ((DAL.OrdenVentaFormato)Container.DataItem).fechaVencimiento.ToShortDateString()%>
                    </td>
                     <td width="75px" align="right">
                        <%# ((DAL.OrdenVentaFormato)Container.DataItem).Moneda.descripcion%>
                    </td>
                    <td width="95px" align="right"> 
                    <%# ((DAL.OrdenVentaFormato)Container.DataItem).total.ToString("N")%>
                     </td>
                    </tr>
                    </table>
                    </ItemTemplate>
                </asp:Repeater>
            </td>
            
            
     <td width="100px"  align="right">
                    <%# Eval("totalCuotaStr")%> <br />
            </td>
        </tr>
    </ItemTemplate>
    <EmptyDataTemplate>
        <table id="Table1" runat="server" style="">
            <tr>
                <td>
                    <h2 style="color: Red ; font-size:small">
                  
                        No existe Informacion.</h2>
                </td>
            </tr>
        </table>
    </EmptyDataTemplate>
</asp:ListView>


  
</asp:Panel>


